<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" import="java.util.*"%>
<%@ page import="dao.BookDAO" %>
<%@ page import="pojo.Book" %>
<!DOCTYPE html>

<html>
<head>
    <title>书籍信息</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <link rel="stylesheet" href="ReadingOcean/resources/books/css/bookInfo.css">
    <link rel="stylesheet" href="ReadingOcean/resources/books/css/common.css">
    <link rel="stylesheet" href="ReadingOcean/resources/books/css/x0popup.min.css">
</head>
<body>
<%@include file="common.jsp" %>
<%
    BookDAO bookDAO = new BookDAO();
    Book book = bookDAO.getBookById(Integer.parseInt(request.getParameter("id")));
    if(book!=null)
    {
%>
<!--主体内容-->
<div class="contanier-bookinfo">
    <!--顶部信息-->
    <div class="top-info">
        <!--书名-->
        <p class="bookname"><%=book.getName()%></p>
        <div class="btn-back">

            <button>返回</button>

        </div>
        <!--封面-->
        <div class="cover">
            <img src="<%=book.getCover()%>" alt="book">
        </div>
        <!--书籍信息-->
        <div class="bookinfo">
            <p>作者：<%=book.getAuthor()%></p>
            <p>出版社：<%=book.getPublisher()%></p>
        </div>

    </div>

    <!--简介-->
    <div class="introduciton">
        <p>简介</p>
        <p><%=book.getBrief()%></p>
    </div>

</div>
<script>
    $('.btn-back button').click(function(){
        location.href = 'review?bk_id=<%=book.getId()%>';
    });
</script>
<%
    }
%>
<script src="ReadingOcean/resources/books/js/x0popup.min.js"></script>
<%--<script src="ReadingOcean/resources/books/js/bookInfo.js"></script>--%>
<%--diy--%>
<%--<script src="ReadingOcean/resources/books/js/myBookInfo.js"></script>--%>

</body>

</html>